package com.spic.business.datamanagement.meetingbefore.controller;

import com.spic.business.datamanagement.meetingbefore.domain.MeetingBeforeAfterDirty;
import com.spic.business.datamanagement.meetingbefore.service.IMeetingBeforeAfterDirtyService;
import com.spic.common.core.web.controller.BaseController;
import com.spic.common.core.web.domain.AjaxResult;
import com.spic.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 班前班后会主Controller
 * 
 * @author 赵祥
 * @date 2022-11-26
 */
@RestController
@RequestMapping("/mettingbefore/dirty")
public class MeetingBeforeAfterDirtyController extends BaseController
{
    @Autowired
    private IMeetingBeforeAfterDirtyService meetingBeforeAfterDirtyService;

    /**
     * 查询班前班后会主列表
     */
    @GetMapping("/list")
    public TableDataInfo list(MeetingBeforeAfterDirty meetingBeforeAfterDirty)
    {
        startPage();
        List<MeetingBeforeAfterDirty> list = meetingBeforeAfterDirtyService.selectMeetingBeforeAfterDirtyList(meetingBeforeAfterDirty);
        return getDataTable(list);
    }

    @GetMapping("statistics")
    public AjaxResult statistics() {
        Map<String, Integer> map = meetingBeforeAfterDirtyService.statistics();
        return AjaxResult.success(map);
    }

}
